package miniproj.models.room;

import miniproj.config.Config;
import miniproj.exception.CapacityException;
import miniproj.models.building.Building;

public class ClassRoom extends Room {

	private static final long serialVersionUID = -1680244493205030673L;

	protected ClassRoom(Building building, int floor, int numRoom,
			int capacity, Equipment[] equipments) {
		super(building, floor, numRoom, capacity, equipments);

		// Use the config min/max capacity values
		//
		minCapacity = Config.CLASSROOM_MIN_CAPACITY;
		maxCapacity = Config.CLASSROOM_MAX_CAPACITY;

		// Control the value of the capacity
		//
		if (capacity < minCapacity || capacity > maxCapacity)
			throw new CapacityException(this, capacity);
	}

	/**
	 * Instantiates a new class room.
	 */
	public ClassRoom() {
	}

	/**
	 * Instantiates a new class room.
	 * 
	 * @param building
	 *            the building in which this room is located
	 * @param floor
	 *            the floor of the room
	 * @param numRoom
	 *            the number of room
	 * @param capacity
	 *            the capacity of the room
	 */
	public ClassRoom(Building building, int floor, int numRoom, int capacity) {
		this(building, floor, numRoom, capacity,
				new Equipment[] { Equipment.VideoProjector });
	}

}
